

#include <vector>
#include <atomic>
#include <memory>
using namespace std;

#include "Timestamp.hpp"
#include "Channel.hpp"

#ifndef EVENTLOOP_H
#define EVENTLOOP_H

namespace tulun
{
    class Channel;
    class Poller;
    class EventLoop
    {
    private:
        using CHannelList = std::vector<Channel *>;
        bool looping_;
        std::atomic<bool> quit_;
        bool eventHandling_;
        int64_t iteration_;

        tulun::Timestamp pollRetunrTime_;
        std::unique_ptr<Poller> poller_;

        ChannelList activeChannels_;

    public:
        EventLoop();
        ~EventLoop();
        void loop();
    };
} // namespace tulun

#endif